package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;

public class OISDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        //将person.obj文件的对象反序列化
        FileInputStream fis=new FileInputStream("person.obj");
        ObjectInputStream ois=new ObjectInputStream(fis);

//        Object obj=ois.readObject();
//        Person person=(Person) obj;
        Person p=(Person)ois.readObject();
        System.out.println(p);

        ois.close();
    }
}
